//
// Created by chaofengan on 23-8-30.
//

#ifndef UNTITLED6_SINGLE_MEMORY_USING_RECORD_H
#define UNTITLED6_SINGLE_MEMORY_USING_RECORD_H
#include "iostream"
#include "math.h"
typedef int exp_int;//单位是Kb
typedef int com_int;
typedef int com_Mb_int;
typedef int com_Kb_int;
#define RELEASE true
#define APPLY false

class single_memory_using_record{
public:
    int pid;
    std::string now_time;
    bool release_or_apply;
    com_Kb_int using_amount;
    int using_position;
public:
    single_memory_using_record(int a_pid,bool a_release_or_reply,int a_using_amount,int a_using_position):pid(a_pid),release_or_apply(a_release_or_reply),using_amount(a_using_amount),using_position(a_using_position){

    }
    void set_time(std::string a_time){
        now_time = a_time;
    }

    void show(){
        std::string apply_or_release_string = release_or_apply?"RELEASE":"APPLY";
        std::cout << "pid: " << pid<<" "
        "using_time: " << now_time <<
        "using_amount: " << using_amount << " "<<
        "using_position: " << using_position << " "<<
        "apply or release: " << apply_or_release_string <<std::endl;
    }
private:
    exp_int giving_block_size(){
        exp_int block_size = ceil(log(using_amount)/log(2));//最适合的空闲块大小。也是指数表示的。
    }
};

#endif //UNTITLED6_SINGLE_MEMORY_USING_RECORD_H
